/*
 * @Author: chyang0822 270917365@qq.com
 * @Date: 2024-11-01 15:41:00
 * @LastEditors: chyang0822 270917365@qq.com
 * @LastEditTime: 2024-11-26 18:50:36
 * @FilePath: /Project-DMAI-Deploy/tutorials/libtorch/test/main.cpp
 * @Description: 
 * 
 * Copyright (c) 2024 by ${git_name_email}, All Rights Reserved. 
 */
#include <iostream>
#include <torch/script.h>
#include <torch/torch.h>

int main(int, char**) {

    torch::Tensor a = torch::randint(10, 20, {3, 2});
    int batch = 5;
    int num_channels = 20;
    torch::Tensor input = torch::rand(
        {batch, num_channels, 10, 10});
    torch::Tensor weight = torch::rand(
        {num_channels});
    torch::Tensor bias = torch::rand(
        {num_channels});
    torch::Tensor running_mean = torch::zeros(
        {num_channels});
    torch::Tensor running_var = torch::ones(
        {num_channels});
    double momentum = 0.1;
    double eps = 1e-05;
    torch::Tensor output = torch::instance_norm(
        input,
        weight,
        bias,
        running_mean,
        running_var,
        /*use_input_stats=*/true,
        momentum,
        eps,
        /*cudnn_enabled=*/false);
    std::cout << a << std::endl;
    std::cout << "Hello, world!\n";
    return 0;
}

